import React from "react";
// import {
//     // RecoilRoot,
//     atom,
//     // selector,
//     // useRecoilState,
//     useRecoilValue,
// } from 'recoil';
import {Link, RouteWithSubRoutes, Switch} from "../../routes/routeUtil";



export default function Recoil({routes}) {


    return (<div>
        <h2>FB推出新一代状态管理库 - Recoil </h2>
        <div>
            <ul>
                <li>
                    <Link to={'/recoil/demo'}>demo</Link>
                </li>
                <li>
                    <Link to={'/recoil/todoList'}>todoList</Link>
                </li>
            </ul>
            <div className="container">
                <Switch>
                    {routes.map((route, i) => (
                        <RouteWithSubRoutes key={i} {...route} />
                    ))}
                </Switch>
            </div>
        </div>
    </div>)
}